
exports.SplashScreen = UI.View.subclass(
{
	classname: 'SplashScreen',
	initialize: function() 
	{
		this._w = Core.Capabilities.getScreenWidth();
		this._h = Core.Capabilities.getScreenHeight();
		this.setFrame([0,0,this._w,this._h]);
		UI.Window.document.addChild(this);

	},

	startSplashScreen: function()
	{
		this._background = UIFactory.getImage([0,0,this._w, this._h], './Content/Default.png');//, scale, gradient, bgColor) 
		this.addChild(this._background);
		setTimeout(this.endSplashScreen.bind(this),1000);
	},

	endSplashScreen: function()
	{
		GALogger.logWithLevel('In endsplash',LOG_LEVEL.LOG_ALL);
		GameCentralHandler.startLoadingScreen();
		this.destroy();
	},

	destroy: function()
	{
		GALogger.logWithLevel('In destroy',LOG_LEVEL.LOG_ALL);

		this.removeChild(this._background);
		this._background.destroy();
		this._background = null;

		NGWindow.document.removeChild(this);
	},

});